Skip to content

merge: bring upstream main (1fc84f6) onto main - #21

Merged
xiaoyumuxi merged 88 commits into
mainfrom
lithe/sync-upstream-2026-11-15
Nov 15, 2026
Merged

xiaoyumuxi merged 88 commits into
mainfrom
lithe/sync-upstream-2026-11-15

Conversation

@xiaoyumuxi

Copy link
Copy Markdown

What this changes

Merges vivaui/viva main (1fc84f6, 87 commits) into the fork's main (4829f2b), as a merge commit (07550af). This is the pre-release sync that Lithe's release rules require: after it, git merge-base --is-ancestor upstream/main main holds again.

This PR must be merged with a merge commit, not squashed. A squash would break the ancestry again, which is what happened with #16.

Conflicts and how they were resolved

The rule: where a fork patch conflicts with upstream's approach, upstream wins. A fork hunk stays only when it carries a patch upstream does not have.

Files Taken Why
29 files: update/*, tools/patchgen/*, cmd/viva feed, help and package, Linux/Windows clipboard and cursor, ui/table.go, components/dropdown_menu.go, internal/platform/contract.go, docs/updating.md, website getting-started, README.zh-CN upstream, whole file Each carried only #16's older copy of an upstream change
README.md, docs/conformance.md, app/driver_system.go upstream hunks v0.6.4; the AppImage/rpm row; driverPreventSleep and AwakeReasons
ui/frame.go, ui/page.go both Upstream PageConfig.Styles sits next to the fork's PageConfig.BarStyle (#13). Styles covers Button, Checkbox, Switch and TextEntry, not scrollbars, so BarStyle stays
components/scroll_area.go, components/tooltip.go fork hunks The scrollbar geometry (#13) and the tooltip's padding and font size, which upstream does not have. The installer templates are regenerated with go run ./tools/componentgen
internal/platform/darwin/testdata/traffic_lights.m fork hunk The title-change test of #5

Removed in favour of upstream

  • ui.MenuAt (ui: MenuAt opens a menu at a point of the window #3) and TestMenuAtOpensAtThePointGiven.
    • Upstream's ui.ContextMenuAt(c, target, open, at, body) does the same job: it opens a context menu at a point the application captured, with ContextMenu rows.
    • The fork's MenuAt no longer compiled against upstream's new declareMenu.
    • ui/menu.go is now byte-identical to upstream.
    • Lithe moves its four callers to ContextMenuAt in the PR that bumps its pin.

Fork patches that remain fork-only

None of these has an upstream PR:

After this merge the fork differs from upstream main in 33 files (+840/−84). These patches are listed in Lithe's sync report.

Why

Lithe's pinned fork commit must contain upstream main before each desktop release, with the fork's own patches on top. Fork main had drifted 87 commits behind, and its merge base with upstream was still c1b073c.

How it was verified

Run on macOS (Apple Silicon, Go toolchain from go.mod):

  • gofmt -l on the merged packages: empty
  • go vet ./...: clean (only the existing Metal didModifyRange: deprecation warning from cgo)
  • go test ./...: every package passes except 14 packaging tests in cmd/viva.
    • They fail with "built for macOS 13.0 or later but [mac] min_system says 12.0".
    • The same 14 fail on a clean checkout of upstream 1fc84f6 on this machine, so the cause is the local SDK's deployment target, not this merge.
  • GOOS=windows GOARCH=amd64 go build ./..., GOOS=windows GOARCH=arm64 go build ./..., GOOS=linux GOARCH=amd64 go build ./...: all build
  • git merge-base --is-ancestor upstream/main HEAD: true

Where the boundary sits

No new capability; this is a sync.

Cost

None beyond upstream's own changes.

t8y2 and others added 30 commits November 13, 2026 21:52
The runtime now records the hovered hit's role, and a menu row only draws its current-item tint when the pointer is not over a non-row control inside the menu. This removes Motty's paint-time focus workaround for the tab colour row.
The rule a Box Drawing or Block Element stroke is drawn with was a fixed
5 percent of the font size, rounded down to whole device pixels. At a 13 px
font on a 2x display that is one device pixel and a heavy stroke two, half
of what the font itself draws: opencode's prompt border (U+2503) turned
into a hairline, and the stroke got relatively thinner as the display
scale rose.

The text engines now report the face's underline thickness
(MonoCellMetrics.Underline), the source Ghostty takes its box thickness
from, and a rule is that thickness at the line's scale rounded up, with a
heavy stroke still two rules. Geometry then weighs what the font's own
glyphs weigh at any size and scale; a canvas without an engine keeps the
reference thickness (internal/textmetrics.MonoUnderline).

Refs: t8y2/motty#822
The test reads the thickness DirectWrite reports for a fixed-pitch face,
which only a Windows runner can execute: the hosted job's name filter
must list it or the COM path is compiled and never run.

Refs: t8y2/motty#822
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Claude Code <noreply@anthropic.com>
A ui.Table whose explicit column widths overflow the room it was given now
scrolls horizontally, its header riding along with its rows. TableState.Scroll
reports the offsets, geometry and viewports of both axes, the wheel moves the
columns horizontally or with Shift held (as a Sideways ScrollArea takes it),
and TableSpec.HorizontalScrollbar names a bar below the body that drags like
the vertical one. ScrollbarGutter now reserves space for either bar.

The default layouts are unchanged: a table whose last column has no width still
lets that column take whatever is left and never scrolls across, and a table
inside a ScrollArea leaves its width to the area, sideways or not. Bounds are
clamped to MaxX/MaxY on every paint, and a warm wide table still paints with
zero allocations (BenchmarkWideTable and the existing table benchmarks at
0 allocs/op).

Closes the horizontal half of the datagrid gap registered in dbxui: wide grids
can now be panned, and reveal/freeze features have a viewport to target.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Add PathStyle.Dashed and Canvas.DashedRoundedOutline: shared tessellation
splits a flattened contour into a 6:4 dash rhythm along its arc length,
fitting a whole number of periods to a closed outline's perimeter so the
pattern closes where it began. Translucent dashes go through the seam-free
stroke decomposition, and a warm outline allocates nothing.

Co-Authored-By: Claude Code <noreply@anthropic.com>
gfx.PointerCursorGrabbing closes the hand while something is dragged:
closedHandCursor on macOS, grabbing on Wayland and X11 cursor themes, the
CSS grabbing keyword on the web, and a cached 16x16 cursor Win32 has no
stock preset for (destroyed with the last window).

Co-Authored-By: Claude Code <noreply@anthropic.com>
InputSnapshot.Alignment places a field's line inside its content box; the
zero value keeps the direction-dependent start alignment fields had. The
value drives the painted line, caret, selection (including the clip
re-paint), composition and the geometry the platform editor is told, so a
right-aligned number field stays right-aligned while focused. ui.Field and
ui.Page pass the declaration to editors that leave their own unset.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Box.Dashed() and Look.Dashed(bool) take an element's border in and out of
the dash pattern, painted over the fill like a translucent border is;
DrawContext.DashedBorder paints a dashed frame with the element's fade.
The generated guide names all three, and the component templates are
regenerated (a stale color-swatch template from main is caught up with it).

Co-Authored-By: Claude Code <noreply@anthropic.com>
The area a self-scrolling Table declared for its bars took X and Width from
its outer frame but Y and Height from the body after the gutter was cut off
it: the vertical bar landed in the gutter it reserved, while the horizontal
bar's track landed on the deepest visible row instead of the strip below the
body — covering the row's hits and taking the right-click on its text, and
leaving the reserved strip empty.

The bars now own the whole frame below the header, the body plus both
reserved gutters, so each bar lands in its own gutter symmetrically with the
other and the corner between two bars stays clear. A gutter also reserves
the component's viewport beside the bars (ReserveScrollbars), matching the
strip the columns and rows have already given up, so a drag maps the body
it scrolls exactly; without a gutter the bars keep riding the table's edges
over its rows, as before — a table with no bar IDs paints none and keeps
the single whole-grid offset the wheel moves.
SetClipboardHTML(html, alt) puts a rich flavour beside a plain one in a
single write: NSPasteboard public.html beside public.utf8-plain-text,
Windows' registered HTML Format (CF_HTML, header of byte offsets)
beside CF_UNICODETEXT, and the CLIPBOARD selection's text/html target
beside UTF8_STRING. The GTK shell serves the same pair through
gtk_clipboard_set_with_data; an older GTK without it reports ErrUnsupported
without disabling plain text. The browser answers through a Promise, so
the synchronous call returns ErrAsyncRequired and SetClipboardHTMLAsync
writes one ClipboardItem with both MIME flavours.

An empty html writes alt with SetClipboardText's exact shape, so the
degradation is the copy the caller already spelled out. The headless
driver stores the pair beside its private clipboard text and clears it
with every other copy, as a real clipboard does.
Wrap tooltip labels to the available viewport instead of applying the
shared eight-line, ellipsizing overlay budget. Unbroken filenames retain
all their text so Motty can identify truncated files without a local
popup implementation.

Refs: #828
Let a table omit its un-owned vertical hover overlay when the application paints its own vertical bar beside it. Keep scrolling, gutter geometry, the horizontal hover bar, and explicitly identified scrollbar interactions unchanged.
CodeMirror's highlightActiveLine paints the row the caret is on even when
the document is empty, so an empty editor's first line has a row background
exactly like any populated caret line. The placeholder guard around
currentLine suppressed that tint whenever Value was empty, leaving an empty
document's first line the only row in the widget without a background.

Keep Placeholder text styling as-is and stop treating an empty document as
if it had no caret line.

Co-Authored-By: Kimi <noreply@moonshot.cn>
ui.Box.TextEnd() aligned a Text but did nothing to an Input, a TextField
or an InputBase: paintInput never read n.textEnd, so a field declared
with .TextEnd() kept the ordinary start alignment. paintTextarea's rows
follow the textarea's own row layout (TextareaSnapshot has no
Alignment), so it was left alone.

paintInput now carries the element's TextEnd() into the snapshot as
AlignEnd when the snapshot left its alignment at the zero value. The
overwrite happens where the snapshot is styled from the element, in the
same direction as FontSize, Weight, Color and Mono: an explicit snapshot
alignment (AlignCenter, AlignRight, AlignEnd or a AlignStart that came
in as AlignLeft, which components treats as the default) is kept, so a
caller that declared its own alignment is never written over. Through
InputSnapshot's own a7345fa paths, the one value drives the painted line,
the caret, the selection, the composition and the text geometry the hit
declares, which focusedTextField, painter.syncTextInput and the Fields /
Page editor fallback chains hand to the platform editor: a focused
number field stays right-aligned.
AF_UNIX exists only from Windows 10 1803 and Windows Server 2019. On every
Windows below that (Windows 10 1607 and 1709, Windows Server 2016)
net.Listen("unix") failed, the dial that followed failed with the same
address-family error, and Claim reported only "no process is listening": the
platform's reason was dropped, so a system without the address looked like an
application that was not running.

Claim at a per-user named pipe on Windows instead. The pipe namespace is
machine-wide, so the name carries a digest of the user's SID; the pipe rejects
remote clients and its ACL admits only its creator. A pipe also needs no
directory, no permission check and no stale-file clean-up. macOS and Linux keep
the Unix socket unchanged.

Claim now names the listener error next to "nobody listens", so a future failure
reports what the platform refused. Motty's accompanying commit stops the fatal
message from naming a log that a run failing before logging never opened.

A copy from a build before this change claims at the socket, so it meets this
build only after every running copy has exited; the in-app updater restarts that
way. Tests ran on macOS and on the physical Windows 11 machine, including the
two-process hand-off; Claim+Close on Windows costs 23 us and 18 allocations.
Splitting the package into per-platform claim files left instance.go and its
shared test untagged while claimAddress lives only in the darwin/linux and
windows files, so GOOS=js GOARCH=wasm go vet failed with "undefined:
claimAddress".

Tag the package for the platforms that have a claim, as app/singleinstance
already is, and narrow owner_unix.go to darwin and linux so no file is left
for the browser target.
Wrapping the label moved from the overlay's own scratch to
canvas.WrapLines(nil, ...), so every warm tooltip paint allocated the line
slice again: the gallery and component demo allocation checks counted four
allocations per paint.

Pass a stack scratch, as the wrapping API asks callers to. The regenerated
tooltip recipe carries the same change.
The empty-document caret tint changed the CodeEditor component without
regenerating its installation recipe, so the generator checks failed.
t8y2 and others added 23 commits November 15, 2026 01:55
ContextMenuAt serves a surface without a hit target — a canvas cell, a column header, an editor — with the ContextMenu look and a dense RowHeight, and it clamps at the window edge instead of flipping to the other side of the pointer. components.ClampOverlay is that placement without the anchor. A context menu opened by its target keeps its own open state, so choosing a row or dismissing it closes it.

Tests cover the captured origin, the 24px rows and the edge clamp; the full ui and components suites pass.
ClampOverlay is part of the popover component source that viva add installs, and the generated template still described the file without it, so the recipe tests failed on every platform.
Application.Post hands work from any goroutine to the thread that owns the windows and the retained scene, in the order it was accepted, without starting a goroutine, timer or blocking wait. Each adapter uses the wake it already has: the main queue on macOS, a coalesced thread message on Windows, the existing command channel on X11 and idle source on GTK; a headless session runs it where it was posted.

There is deliberately no call-the-loop-and-wait form: waiting on the loop from the loop deadlocks, and pumping the native event loop to avoid it (as an immediate-mode framework does) would put a platform detail in the public API. Results belong where the next wake or paint reads them.
Application.SetMenuBar installs the application's File, Edit and View menus between the system's application menu and its Window menu: key equivalents from a character chord, enablement, check marks, submenus, and loop-thread actions. A C bridge builds the NSMenus and one Go-exported dispatcher runs the entry's action; the standard Hide and Window items keep AppKit's behaviour and Command+W stays with the application.

Windows and Linux return ErrUnsupported rather than faking a system menu bar; their applications keep using components.Menubar. The Darwin test compiles the real Objective-C and checks order, shortcuts, state, submenus and action dispatch.
Read returns a file's bytes and the SHA-256 revision that names them; Save writes a temporary file in the same directory, syncs it, checks once more that the file is still the expected revision, renames over it and syncs the directory, keeping the old mode; Changed reports whether another program replaced, wrote or removed it. Symbolic links and non-regular files are refused, and a missing file is created only from the zero revision.

The editor, its format and its autosave policy stay the application's; this is the storage half both a Viva editor and an application's own document model share.
The machine is a Debian 12 x86_64 desktop container with Xvnc at 1920x1080 and DISPLAY=:1, with no Vulkan device or discrete GPU: rendering is software. The user and password stay in the git-ignored local.sh.
The flood scenario bounded wakes by a 120 Hz frame grid, but a window presenting to a software surface (a Windows virtual machine's WARP, a CPU fallback) legitimately runs faster than a monitor. The invariant is now what the scenario is about: at least one wake, and far fewer wakes than the Invalidate calls that asked for them.
cfHTML wrote the offsets without their field names (the fixed-width header constant was never used), so a paste target could not parse a rich copy; it now formats StartHTML, EndHTML, StartFragment and EndFragment with ten digits. closeGrabbingCursor destroyed the handle but left the sync.Once done, so the rest of the process asked for a destroyed cursor; the cache can be built again, and the test asserts a live handle rather than comparing opaque values.

The compositing test's expectation put layer 2's text before its shape, contradicting the paint order the label's ShapesBefore records; the algorithm and the expectation now agree. All found by running internal/platform/windows on the Windows test VM, which CI does not run.
KeyEvent.Text is the character without any modifier applied, with what was
held reported in Modifiers. The XCB, GTK and macOS raw-key paths applied
Shift to that character, so Control+Shift+C arrived as "C"; a terminal that
identifies its copy chord by "c" then encoded it as Control+C instead.
A text input that sets DisableIME (a surface showing another machine's
remote desktop) still sent its keys through the host's text system on
macOS, so the local input method composed and showed its candidates over
the picture. The flag was honored on Windows only.

macOS now never exposes such a surface to the text system: the input
context is deactivated, printable keys reach a terminal-role surface as
raw presses with their base character and the text they type, named keys
keep their existing route, and an ordinary field takes what the layout
types as a text event. A composition held when the flag turns on is
discarded, and the flag joins the presentation comparison so turning it
on is never mistaken for the field only moving.

Motty's remote desktop already declares the flag, so its keys now reach
the input method of the machine on the other side.
Bring the fork up to upstream before the next Lithe desktop release. The
merge base is c1b073c: the #16 sync was squashed, so upstream's history
after it was never an ancestor of the fork.

Conflicts, resolved in upstream's favour unless a fork patch upstream does
not have depends on the line:

- Taken from upstream whole (29 files): the update/patch tooling, the feed
  and package commands, the clipboard and cursor code for Linux and Windows,
  ui/table.go, components/dropdown_menu.go, the platform contract, and the
  docs and website pages. Each of them only carried #16's older copy of an
  upstream change.
- README.md, docs/conformance.md, app/driver_system.go: upstream's hunks
  (v0.6.4, the AppImage/rpm row, driverPreventSleep and AwakeReasons).
- ui/frame.go, ui/page.go: both. Upstream's PageConfig.Styles and the fork's
  PageConfig.BarStyle (#13) sit side by side; Styles covers no scrollbar, so
  BarStyle stays.
- components/scroll_area.go, components/tooltip.go: the fork's hunks, which
  carry the scrollbar geometry (#13) and the configurable tooltip padding
  and font size; the installer templates are regenerated from them.
- internal/platform/darwin/testdata/traffic_lights.m: the fork's hunk, the
  title-change test of #5.

Dropped in favour of upstream:

- ui.MenuAt (#3) and TestMenuAtOpensAtThePointGiven. Upstream's
  ui.ContextMenuAt opens a context menu at a point the application chose,
  with the same rows; callers move to it.
@xiaoyumuxi

Copy link
Copy Markdown
Author

CI: 19 jobs pass. The three that fail do not come from this merge:

  • size: hello darwin/arm64 is 4,258,658 B against the 3,840,000 B limit. Upstream 1fc84f6 is already 4,258,498 B in its own run (vivaui/viva actions run 43686053756), and fork main 4829f2b failed the same check at 4,172,722 B. The merge adds 160 B.
  • benchmarks: BenchmarkCursorMoveMixedText is 20% above "the median 556 of the last 1 runs". There is a single sample, so this is noise.
  • ci passed: only collects the two above.

Merging with a merge commit, as the sync rule requires.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants